//
//  YTCustomerServiceChatViewController.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/7/6.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "YTCustomerServiceChatViewController.h"
#import <IQKeyboardManager/IQKeyboardManager.h>

@interface YTCustomerServiceChatViewController ()

@end

@implementation YTCustomerServiceChatViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [IQKeyboardManager sharedManager].enable = NO;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [IQKeyboardManager sharedManager].enable = YES;
}

// 更新消息未读数
- (void)notifyUpdateUnreadMessageCount {
    int count =  [[RCIMClient sharedRCIMClient] getUnreadCount:@[@(ConversationType_PRIVATE),
                                                               @(ConversationType_DISCUSSION),
                                                               @(ConversationType_APPSERVICE),
                                                               @(ConversationType_PUBLICSERVICE),
                                                               @(ConversationType_GROUP)]];
    [[NSNotificationCenter defaultCenter] postNotificationName:YTUserUnreadMessageNotification
                                                        object:[NSNumber numberWithInt:count]];
}

@end
